let mysql = require('mysql')
let db = mysql.createPool({
    host:'127.0.0.1',
    user:'root',
    password:'mysql', //注意你们的是  ''
    database:'sobook',
    multipleStatements: true ,//允许多余查询
    
})
module.exports={
    db,
    sqlQuery:function(){
        db.query('select 1',(err,data)=>{
            if(err){
                return console.log('数据库连接失败',err)
            }
            console.log('数据库连接成功')
        })
    }
}